package c.h.a.j0;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.e;
import androidx.recyclerview.widget.RecyclerView.z;
import c.h.a.d0.f;
import com.huawei.hms.jos.games.ranking.RankingConst;
import com.liuzh.deviceinfo.DeviceInfoApp;
import com.liuzh.deviceinfo.sensors.SensorDetailActivity;
import java.util.List;

/* compiled from: TabSensors */
public class w0 extends h0 {
    public View W;

    /* compiled from: TabSensors */
    public class a extends e<a> {
        public List<f> c;
        public String d = DeviceInfoApp.c.getString(2131690514);

        /* compiled from: TabSensors */
        public class a extends z implements OnClickListener {
            public TextView t;
            public TextView u;
            public TextView v;
            public TextView w;
            public TextView x;
            public ImageView y;

            public a(View view) {
                super(view);
                this.t = (TextView) view.findViewById(2131296886);
                this.u = (TextView) view.findViewById(2131297326);
                this.v = (TextView) view.findViewById(2131296887);
                this.w = (TextView) view.findViewById(2131297336);
                this.x = (TextView) view.findViewById(2131296888);
                this.y = (ImageView) view.findViewById(2131296628);
                view.setOnClickListener(this);
            }

            public void onClick(View view) {
                f fVar = (f) a.this.c.get(e());
                Intent intent = new Intent(view.getContext(), SensorDetailActivity.class);
                intent.putExtra(RankingConst.RANKING_JGW_NAME, fVar.a);
                intent.putExtra("type", fVar.f);
                intent.putExtra("icon", fVar.g);
                w0.this.l0(intent);
            }
        }

        public a(List<f> list) {
            this.c = list;
        }

        public int a() {
            return this.c.size();
        }

        @SuppressLint({"SetTextI18n"})
        public void f(z zVar, int i) {
            a aVar = (a) zVar;
            f fVar = (f) this.c.get(i);
            if (this.d.equals(fVar.c)) {
                aVar.t.setText(fVar.a);
            } else {
                aVar.t.setText(fVar.c);
            }
            aVar.u.setText(fVar.b);
            TextView textView = aVar.v;
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(DeviceInfoApp.c.getString(2131690120));
            stringBuilder.append(" : ");
            stringBuilder.append(fVar.a);
            textView.setText(stringBuilder.toString());
            aVar.w.setText(fVar.d);
            aVar.x.setText(fVar.e);
            aVar.y.setImageResource(fVar.g);
        }

        public z g(ViewGroup viewGroup, int i) {
            return new a(LayoutInflater.from(viewGroup.getContext()).inflate(2131492992, viewGroup, false));
        }
    }

    @SuppressLint({"SetTextI18n"})
    public View G(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        if (this.W == null) {
            View inflate = layoutInflater.inflate(2131493057, viewGroup, false);
            this.W = inflate;
            new Thread(new y(this, (TextView) this.W.findViewById(2131296884), (RecyclerView) inflate.findViewById(2131296829))).start();
        }
        return this.W;
    }

    public String r0() {
        return DeviceInfoApp.c.getString(2131690324);
    }
}
